package com.lancoo.answer.ui.ques;

import android.graphics.Typeface;
import android.os.Build;
import android.os.Bundle;
import android.text.Html;
import android.text.Layout;
import android.text.SpannableString;
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.TextUtils;
import android.text.style.AbsoluteSizeSpan;
import android.text.style.AlignmentSpan;
import android.text.style.ForegroundColorSpan;
import android.text.style.StrikethroughSpan;
import android.text.style.StyleSpan;
import android.text.style.TypefaceSpan;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.lancoo.answer.R;
import com.lancoo.answer.model.AnswerConstant;
import com.lancoo.answer.model.ConstantBean;
import com.lancoo.answer.model.bean.Ques;
import com.lancoo.answer.model.bean.Type;
import com.lancoo.answer.model.entity.TaskControlBean;
import com.lancoo.answer.model.entity.TaskOperateBean;
import com.lancoo.answer.util.DpUtils;
import com.lancoo.answer.util.ExamFontSizeAdjustUtils;
import com.lancoo.answer.util.paperUtils.DecimalFormatUtils;
import com.lancoo.answer.util.paperUtils.KindIndexStringUtils;

import java.util.List;


/**
 * Created by pengmi on 2021/12/1 13:41
 * Description:导语界面
 */
public class IntroductionFragment extends Fragment {


    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return inflater.inflate(R.layout.ev_fragment_introduction, container, false);
    }

    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        initView(view);
    }


    private void initView(View view){
        adjustFontSize();
        if(ConstantBean.Companion.getConstantExamBean()==null){
            return;
        }
        List<Type> kindBeanList= ConstantBean.Companion.getConstantExamBean().getTypeList();
        if(getArguments()==null||kindBeanList==null){
            return;
        }
        int typeIndex = getArguments().getInt(AnswerConstant.KEY_TYPEINDEX);
        int quesIndex = getArguments().getInt(AnswerConstant.KEY_QUESINDEX);
        Type type = kindBeanList.get(typeIndex);
        if(type.getTypeIndex()>0){
            typeIndex=type.getTypeIndex()-1;
        }
        if(quesIndex==0){
            loadDirectionContent(view,type);
        }else{
            view.findViewById(R.id.tv_direction).setVisibility(View.GONE);
        }

        TextView tv_gesture=view.findViewById(R.id.tv_gesture);
        ImageView img_gesture=view.findViewById(R.id.img_gesture);
        img_gesture.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
            @Override
            public void onGlobalLayout() {
                img_gesture.getViewTreeObserver().removeOnGlobalLayoutListener(this);
                int height = img_gesture.getHeight();
                int height1 = tv_gesture.getHeight();//126 65

                int marginTopHeight=(65*height/130-height1)/2;
                tv_gesture.setPadding(0,marginTopHeight,0,0);
            }
        });
        boolean isShowSign=getArguments().getBoolean("isShowSign");
        if(isShowSign){
            tv_gesture.setVisibility(View.VISIBLE);
            img_gesture.setVisibility(View.VISIBLE);
        }else{
            tv_gesture.setVisibility(View.INVISIBLE);
            img_gesture.setVisibility(View.INVISIBLE);
        }
        if(getContext()==null){
            return;
        }
        try{
            Typeface typeFace = Typeface.createFromAsset(getContext().getAssets(), "happyZCool.ttf");
            tv_gesture.setTypeface(typeFace);
        }catch (Exception e){
            e.printStackTrace();
        }
        TaskControlBean taskControlBean = ConstantBean.Companion.getTaskControlBean();
        int trainSence = taskControlBean.getTrainSence();
        int paperType = taskControlBean.getPaperType();
        if(paperType==3){
            loadImportPaperIntroduce(view,type.getTypeLeader(),type,quesIndex);
            return;
        }
        if(paperType==2){
            trainSence=1;
        }
        if(taskControlBean!=null&&trainSence>=2){
            if(quesIndex>0){
                view.findViewById(R.id.tv_kind_name).setVisibility(View.GONE);
            }else{
                loadGradeExamTitle(view,type);
            }

        }else{
            loadNormalTypeTitle(view,type,typeIndex);
        }
        if(quesIndex==0){
            loadExampleContent(view,type);
        }

        loadQuesSectionMessage(view,type,quesIndex);
        loadQuesDirectionMessage(view,type,quesIndex);

    }

    public static Fragment loadTopicFragment(TaskOperateBean taskOperateBean){
        IntroductionFragment fragment=new IntroductionFragment();
        Bundle mBundle=new Bundle();
        mBundle.putInt(AnswerConstant.KEY_TYPEINDEX,taskOperateBean.getTypeIndex());
        mBundle.putInt(AnswerConstant.KEY_QUESINDEX,taskOperateBean.getQuesIndex());
        mBundle.putInt("totalQueseCount",taskOperateBean.getTotalQueseCount());
        mBundle.putBoolean("isShowSign",taskOperateBean.isShowSign());
        fragment.setArguments(mBundle);
        return fragment;
    }

    private String getStr(Ques ques){
        if(ques==null){
            return "";
        }
        String typeNo = ques.getTypeNo();
        if(typeNo==null){
            return "";
        }
        switch (typeNo){
            case "S":
            case "W":
                return "答案复核时长";
        }
        return "小题作答时长";
    }

    /**
     * 加载导语内容
     * @param view rootView
     * @param type Type
     */
    private void loadDirectionContent(View view, Type type){
        if(getContext()==null){
            return;
        }
        TextView tv_direction=view.findViewById(R.id.tv_direction);
        SpannableStringBuilder spannableStringBuilder=new SpannableStringBuilder();
        SpannableString spannableString=new SpannableString("Directions: ");
        spannableString.setSpan(new StyleSpan(Typeface.BOLD),0,spannableString.length(),Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
        spannableStringBuilder.append(spannableString);
        SpannableString spannableString1=new SpannableString(Html.fromHtml(type.getTypeLeader() == null?"":type.getTypeLeader()));

        try{
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
                Typeface typeFace1 = Typeface.createFromAsset(getContext().getAssets(), "fonts/TimesNewRomanPS-ItalicMT.otf");
                spannableString1.setSpan(new TypefaceSpan(typeFace1),0,spannableString1.length(),Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
            }else{
                spannableString1.setSpan(new StyleSpan(Typeface.ITALIC),0,spannableString1.length(),Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
            }
        }catch (Exception e){
            spannableString1.setSpan(new StyleSpan(Typeface.ITALIC),0,spannableString1.length(),Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
            e.printStackTrace();
        }

        spannableStringBuilder.append(spannableString1);
        tv_direction.setText(spannableStringBuilder);
        if(TextUtils.isEmpty(type.getTypeLeader())){
            tv_direction.setVisibility(View.GONE);
        }
    }

    /**
     * 加载练习，普通考试题型标题
     * @param view rootView
     * @param type Type
     * @param typeIndex index
     */
    private void loadNormalTypeTitle(View view, Type type, int typeIndex){
        TextView tv_typeIndex=view.findViewById(R.id.tv_kind_name_index);
        tv_typeIndex.setText(String.format("%s、", KindIndexStringUtils.getOrderIndex(typeIndex)));
        TaskControlBean taskControlBean = ConstantBean.Companion.getTaskControlBean();
        if(type.getQuesList()==null||getArguments()==null){
            return;
        }
        boolean hideLeadPagerScore = taskControlBean.isHideLeadPagerScore();
        int totalQueseCount=getArguments().getInt("totalQueseCount");
        Ques ques = type.getQuesList().get(0);
        String typeNo = ques.getTypeNo();
        boolean isCompositeQues=false;//是否是复合体
        if(TextUtils.equals(typeNo,"H")){
            isCompositeQues=true;
        }
        String totalScore=type.getTotalScore();
        if(totalScore==null){
            totalScore="0";
        }
        if(!isCompositeQues){
            try{
                float v = Float.parseFloat(totalScore);
                float avgScore=v/totalQueseCount;
                totalScore=DecimalFormatUtils.RoundToTheNearestDecimalPlace(avgScore);
            }catch (Exception e){
                e.printStackTrace();
            }
        }else{
            try{
                float v = Float.parseFloat(totalScore);
                totalScore=DecimalFormatUtils.RoundToTheNearestDecimalPlace(v);
            }catch (Exception e){
                e.printStackTrace();
            }
        }
        TextView tv_kindName=view.findViewById(R.id.tv_kind_name);
        String name=type.getOtherName();
        if(TextUtils.isEmpty(name)){
            name=type.getGenreName();
        }
        if(TextUtils.isEmpty(name)){
            name=type.getTypeName();
        }
        SpannableStringBuilder ssb=new SpannableStringBuilder();
        ssb.append(TextUtils.isEmpty(name)?"":name);
        if(!hideLeadPagerScore){
            int textSize=13;
            SpannableString ss1=new SpannableString(" (共 ");
            ss1.setSpan(new AbsoluteSizeSpan(textSize,true),0,ss1.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
            ssb.append(ss1);
            SpannableString ss2=new SpannableString(""+totalQueseCount);
            ss2.setSpan(new AbsoluteSizeSpan(textSize,true),0,ss2.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
            ss2.setSpan(new ForegroundColorSpan(0xff0099ff),0,ss2.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
            ssb.append(ss2);
            String ss3Str=" 小题，每小题 ";
            if(isCompositeQues){
                ss3Str=" 小题，共 ";
            }
            SpannableString ss3=new SpannableString(ss3Str);
            ss3.setSpan(new AbsoluteSizeSpan(textSize,true),0,ss3.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
            ssb.append(ss3);
            SpannableString ss4=new SpannableString( totalScore);
            ss4.setSpan(new AbsoluteSizeSpan(textSize,true),0,ss4.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
            ss4.setSpan(new ForegroundColorSpan(0xff0099ff),0,ss4.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
            ssb.append(ss4);
            SpannableString ss5=new SpannableString(" 分");
            ss5.setSpan(new AbsoluteSizeSpan(textSize,true),0,ss5.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
            ssb.append(ss5);

            if(ques.getAudioPlayTimes()>0
                    &&!TextUtils.equals("W",typeNo)){//播放次数
                SpannableString ss7=new SpannableString("，播放次数 ");
                ss7.setSpan(new AbsoluteSizeSpan(textSize,true),0,ss7.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
                ssb.append(ss7);

                SpannableString ss8=new SpannableString(ques.getAudioPlayTimes()+"");
                ss8.setSpan(new AbsoluteSizeSpan(textSize,true),0,ss8.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
                ss8.setSpan(new ForegroundColorSpan(0xff0099ff),0,ss8.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
                ssb.append(ss8);

                SpannableString ss9=new SpannableString(" 次");
                ss9.setSpan(new AbsoluteSizeSpan(textSize,true),0,ss9.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
                ssb.append(ss9);

            }
            if(ques.getQuesAnswerTime()>0){//作答时长
                SpannableString ss7=new SpannableString("，"+getStr(ques)+" ");
                ss7.setSpan(new AbsoluteSizeSpan(textSize,true),0,ss7.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
                ssb.append(ss7);

                SpannableString ss8=new SpannableString(ques.getQuesAnswerTime()+"");
                ss8.setSpan(new AbsoluteSizeSpan(textSize,true),0,ss8.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
                ss8.setSpan(new ForegroundColorSpan(0xff0099ff),0,ss8.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
                ssb.append(ss8);

                SpannableString ss9=new SpannableString(" 秒");
                ss9.setSpan(new AbsoluteSizeSpan(textSize,true),0,ss9.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
                ssb.append(ss9);
            }
            SpannableString ss6=new SpannableString(")");
            ss6.setSpan(new AbsoluteSizeSpan(textSize,true),0,ss6.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
            ssb.append(ss6);
        }

        tv_kindName.setText(ssb);
    }


    /**
     * 加载example内容
     * @param view rootView
     * @param type type
     */
    private void loadExampleContent(View view, Type type ){
        TaskControlBean taskControlBean = ConstantBean.Companion.getTaskControlBean();
        String exampleMsg = type.getExampleMsg();
        if(TextUtils.isEmpty(exampleMsg)||getContext()==null||taskControlBean==null){
            return;
        }
        TextView tv_example = view.findViewById(R.id.tv_example);
        tv_example.setVisibility(View.VISIBLE);
        SpannableStringBuilder ssb=new SpannableStringBuilder();
        SpannableString ss1=new SpannableString("Example: ");
        ss1.setSpan(new StyleSpan(Typeface.BOLD),0,ss1.length(),
                Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
        SpannableString ss2=new SpannableString("Example: ");
        ss2.setSpan(new ForegroundColorSpan(0x00000000),0,ss2.length(),Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);

        SpannableString ss3=new SpannableString("You will read: ");
        ss3.setSpan(new ForegroundColorSpan(0x00000000),0,ss3.length(),Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
        SpannableStringBuilder ssb_append=new SpannableStringBuilder();
//        if(DpUtils.isPad(getContext())){
//            ss2.setSpan(new ForegroundColorSpan(0x00000000),0,ss2.length(),Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
//            ssb_append.append(ss2);
//        }
        ssb_append.append("You will hear:\n");
        if(DpUtils.isPad(getContext())){
            ss2.setSpan(new ForegroundColorSpan(0x00000000),0,ss2.length(),Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
            ssb_append.append(ss2);
        }
        if(taskControlBean.getPaperType()==0){
            ssb_append.append("You will read: A) New York City.  B) An evening party.\n");
        }else{
            ssb_append.append("You will read: A) I'm not sure.  B) You're right.\n");
        }

        if(DpUtils.isPad(getContext())){
            ss2.setSpan(new ForegroundColorSpan(0x00000000),0,ss2.length(),Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
            ssb_append.append(ss2);
        }
        ssb_append.append(ss3);
        if(taskControlBean.getPaperType()==0){
            ssb_append.append("C) An air trip.     D) The man's job.\n");
            ssb_append.append("From the dialogue we learn that the man is to take a fight to New York. Therefore, ");
        }else{
            ssb_append.append("C) Yes, certainly. D) That's interesting.\n");
            ssb_append.append("From the question we learn that the speaker is asking the listener to leave a message. Therefore, ");
        }
        SpannableString ss4=new SpannableString(taskControlBean.getPaperType()==0?"C) An air trip":"C) Yes, certainly");
        ss4.setSpan(new StyleSpan(Typeface.BOLD),0,ss4.length(),
                Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
//        ss4.setSpan(new ForegroundColorSpan(0xff0099ff),0,ss4.length(),Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
        ssb_append.append(ss4);
        ssb_append.append(" is the correct answer. You should mark C).\n");
        SpannableString ss5=new SpannableString("[A] [B] [C] [D]\n");
        AlignmentSpan.Standard alignmentSpan = new AlignmentSpan.Standard(Layout.Alignment.ALIGN_OPPOSITE);
        ss5.setSpan(alignmentSpan,0,ss5.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
        ss5.setSpan(new StrikethroughSpan(),ss5.length()-8,ss5.length()-5,Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
//        ss5.setSpan(new StyleSpan(Typeface.BOLD),ss5.length()-8,ss5.length()-5,
//                Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
        ssb_append.append(ss5);
        SpannableString ss6=new SpannableString("Now the test will begin.");
        try{
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
                Typeface typeFace1 = Typeface.createFromAsset(getContext().getAssets(), "fonts/TimesNew.ttf");
                ssb_append.setSpan(new TypefaceSpan(typeFace1),0,ssb_append.length(),Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
                ss6.setSpan(new TypefaceSpan(typeFace1),0,ss6.length(),Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
                ss5.setSpan(new TypefaceSpan(typeFace1),0,ss5.length(),Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
            }else{
                ssb_append.setSpan(new StyleSpan(Typeface.ITALIC),0,ssb_append.length(),Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
                ss6.setSpan(new StyleSpan(Typeface.ITALIC),0,ss6.length(),Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
                ss5.setSpan(new StyleSpan(Typeface.ITALIC),0,ss5.length(),Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
            }
        }catch (Exception e){
            ssb_append.setSpan(new StyleSpan(Typeface.ITALIC),0,ssb_append.length(),Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
            ss5.setSpan(new StyleSpan(Typeface.ITALIC),0,ss5.length(),Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
            e.printStackTrace();
        }
        ssb.append(ss1);
        if(!DpUtils.isPad(getContext())){
            ssb.append("\n");
        }
        ssb.append(ssb_append);
//        ssb.append(ss5);
        ssb.append(ss6);
        tv_example.setText(ssb);
    }


    private void loadGradeExamTitle(View view,Type type){
        view.findViewById(R.id.tv_kind_name).setVisibility(View.GONE);
        TextView tv_title = view.findViewById(R.id.tv_kind_name_index);
        tv_title.getPaint().setFakeBoldText(true);
        tv_title.setText(type.getPartMsg());
        if(!TextUtils.isEmpty(type.getSectionMsg())){
            TextView tv_section = view.findViewById(R.id.tv_section);
            tv_section.setText(type.getSectionMsg());
            tv_section.setVisibility(View.VISIBLE);
        }
    }

    /**
     * 加载ques的Section内容
     * @param view rootview
     * @param type type
     */
    private void loadQuesSectionMessage(View view, Type type,int quesIndex){
        List<Ques> quesList = type.getQuesList();
        Ques ques = quesList.get(quesIndex);
        String quesSectionMsg = ques.getQuesSectionMsg();
        if(TextUtils.isEmpty(quesSectionMsg)){
            return;
        }
        TextView tv_quesSection = view.findViewById(R.id.tv_ques_section);
        tv_quesSection.setText(quesSectionMsg);
        tv_quesSection.setVisibility(View.VISIBLE);


    }
    /**
     * 加载ques的Directions内容
     * @param view rootview
     * @param type type
     */
    private void loadQuesDirectionMessage(View view, Type type,int quesIndex){
        ;
        List<Ques> quesList = type.getQuesList();
        Ques ques = quesList.get(quesIndex);
        String quesQuesLeader = ques.getQuesLeader();

        if(TextUtils.isEmpty(quesQuesLeader)||getContext()==null){
            return;
        }
        Log.e("12321",quesQuesLeader);
        TextView tv_quesDirection = view.findViewById(R.id.tv_ques_direction);
        tv_quesDirection.setVisibility(View.VISIBLE);
        SpannableStringBuilder spannableStringBuilder=new SpannableStringBuilder();
        SpannableString spannableString=new SpannableString("Directions: ");
        spannableString.setSpan(new StyleSpan(Typeface.BOLD),0,spannableString.length(),Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
        spannableStringBuilder.append(spannableString);
        SpannableString spannableString1=new SpannableString(Html.fromHtml(quesQuesLeader));

        try{
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
                Typeface typeFace1 = Typeface.createFromAsset(getContext().getAssets(), "fonts/TimesNew.ttf");
                spannableString1.setSpan(new TypefaceSpan(typeFace1),0,spannableString1.length(),Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
            }else{
                spannableString1.setSpan(new StyleSpan(Typeface.ITALIC),0,spannableString1.length(),Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
            }
        }catch (Exception e){
            spannableString1.setSpan(new StyleSpan(Typeface.ITALIC),0,spannableString1.length(),Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
            e.printStackTrace();
        }

        spannableStringBuilder.append(spannableString1);
        tv_quesDirection.setText(spannableStringBuilder);
    }

    private void loadImportPaperIntroduce(View view,String quesLead,Type type,int quesIndex){
        TextView textView=view.findViewById(R.id.tv_kind_name_index);
        textView.setText(Html.fromHtml(quesLead));
        view.findViewById(R.id.tv_kind_name).setVisibility(View.GONE);
        view.findViewById(R.id.tv_section).setVisibility(View.GONE);
        view.findViewById(R.id.tv_direction).setVisibility(View.GONE);
        view.findViewById(R.id.tv_ques_section).setVisibility(View.GONE);
        view.findViewById(R.id.tv_ques_direction).setVisibility(View.GONE);
        view.findViewById(R.id.tv_example).setVisibility(View.GONE);
        String typeLeader = type.getTypeLeader();
        String quesLeader = type.getQuesList().get(quesIndex).getQuesLeader();
        if(quesIndex==0){
            textView.setText(String.format("%s%s", Html.fromHtml(typeLeader).toString().trim(), Html.fromHtml(quesLeader).toString().trim()));
        }else{
            textView.setText(Html.fromHtml(quesLeader).toString().trim());
        }
    }

    public void adjustFontSize(){
        View view = getView();
        if(view==null){
            return;
        }
        TextView textView = view.findViewById(R.id.tv_kind_name_index);
        ExamFontSizeAdjustUtils.adjustTextViewFontSize(textView,15);
        TextView textView1 = view.findViewById(R.id.tv_kind_name);
        ExamFontSizeAdjustUtils.adjustTextViewFontSize(textView1,15);
        TextView textView2 = view.findViewById(R.id.tv_section);
        ExamFontSizeAdjustUtils.adjustTextViewFontSize(textView2,14);
        TextView textView3 = view.findViewById(R.id.tv_direction);
        ExamFontSizeAdjustUtils.adjustTextViewFontSize(textView3,14);
        TextView textView4 = view.findViewById(R.id.tv_ques_section);
        ExamFontSizeAdjustUtils.adjustTextViewFontSize(textView4,14);
        TextView textView5 = view.findViewById(R.id.tv_ques_direction);
        ExamFontSizeAdjustUtils.adjustTextViewFontSize(textView5,14);
        TextView textView6 = view.findViewById(R.id.tv_example);
        ExamFontSizeAdjustUtils.adjustTextViewFontSize(textView6,14);
        TextView textView7 = view.findViewById(R.id.tv_gesture);
        ExamFontSizeAdjustUtils.adjustTextViewFontSize(textView7,17);
    }


}
